﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using Top.Api.Domain;
using DBControl;


namespace SellerProject
{
    public partial class test2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //Session["sessionKey"] = Request.QueryString["top_session"];//取得用户session
            //string strParameters = Request.QueryString["top_parameters"];
            //SystemLib slib = new SystemLib();
            //Session.Add("usNick", slib.GetParameters(strParameters, "visitor_nick"));//取得用户昵称

            //ItopInit itop = new ItopInit();
            //itop.sellcatGet(Session["usNick"].ToString());
            //List<SellerCat> childlist = new List<SellerCat>();

            //StringBuilder sbnode = new StringBuilder();
            //sbnode.Append("var zNodes = [");
            //for (int i = 0; i < itop.sclistres.SellerCats.Count; i++)
            //{
            //    if (i == itop.sclistres.SellerCats.Count){sbnode.Append("{id:'" + itop.sclistres.SellerCats[i].Cid.ToString() + "', pId:'" + itop.sclistres.SellerCats[i].ParentCid.ToString() + "', name:'" + itop.sclistres.SellerCats[i].Name.ToString() + "'}");}
            //    else if (itop.sclistres.SellerCats[i].ParentCid == 0){sbnode.Append("{id:'" + itop.sclistres.SellerCats[i].Cid.ToString() + "', pId:'0', name:'" + itop.sclistres.SellerCats[i].Name.ToString() + "'},");}
            //    else {sbnode.Append("{id:'" + itop.sclistres.SellerCats[i].Cid.ToString() + "', pId:'" + itop.sclistres.SellerCats[i].ParentCid.ToString() + "', name:'" + itop.sclistres.SellerCats[i].Name.ToString() + "'},");}
            //}
            //sbnode.Append("];");

            //StringBuilder sb = new StringBuilder();
            //sb.Append("<script language='javascript'>");
            //sb.Append(sbnode.ToString());
            //sb.Append("$(document).ready(function () { zTree = $('#tree').zTree(setting, zNodes) });"); //此处写JS代码
            //sb.Append("</script>");

            //ClientScript.RegisterClientScriptBlock(this.GetType(), "alert1", sb.ToString());
        }
    }
}